using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;

namespace Wax.Provider
{
    /// <summary>
    /// Implements a mock provider that reads and writes test scripts
    /// </summary>
    public class WaxMockDataProvider : WaxDataProviderBase
    {
        /// <summary>
        /// Parses the file and returns a Collection of <see cref="Test">tests</see>.
        /// </summary>
        /// <param name="fileName">The filename.</param>
        /// <returns></returns>
        public override Collection<Test> ParseFile(string fileName)
        {
            Collection<Test> tests = new Collection<Test>();
            
            Test test = new Test();
            Command command = CommandFactory.Parse(new string[] { "GotoHome", "Goto", "http://www.google.co.uk", string.Empty, string.Empty });
            test.Commands.Add(command);
            test.Commands.Add(CommandFactory.Parse(new string[] { "GotoHomeb", "Goto", "testpage1b.htm", string.Empty, string.Empty }));
            test.Id = "test1";
            tests.Add(test);

            test = new Test();
            command = CommandFactory.Parse(new string[] { "GotoHome2", "Goto", "testpage2.htm", string.Empty, string.Empty });
            test.Commands.Add(command);
            test.Id = "2";
            tests.Add(test);

            return tests;
        }
    }
}
